<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str = "hello"
        console.log(str.length);
        var s = "故事的结尾，心上人"
        console.log(handleStr(s));

        function handleStr(value){
            if(value.length>5){
                return value.slice(0,5)+"..."
            }
            return value
        }
    </script>
</body>
</html>